home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4937 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: galaxy.ucr.edu!not-for-mail
  2. From: thp@cs.ucr.edu (Tom Payne)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Undefined behavior? on type conversion, was: Re: Hungarian notation
  5. Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  6. Date: 1 Feb 1996 19:03:52 GMT
  7. Organization: University of California, Riverside Department of Computer Science
  8. Message-ID: <4er2qo$h2s@galaxy.ucr.edu>
  9. References: <30C40F77.53B5@swsbbs.com> <4d2ok0$69s@beach.and.nl>
  10. NNTP-Posting-Host: corvette.ucr.edu
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12.  
  13. James Kanze US/ESC 60/3/141 #40763 (kanze@lts.sel.alcatel.de) wrote:
  14. : miker3@ix.netcom.com (Mike Rubenstein) writes:
  15. : [...]
  16. : |> Is it really necessary to post this kind of nonsense.  No, the
  17. : |> documentation may not say the result is to delete your system disk.
  18. : |> Repeating the quote from ISO 6.2.1.2
  19. : |>     When a value with integral type is demoted to a signed integer
  20. : |>     with smaller size or an unsigned integer is converted to its 
  21. : |>     corresponding signed integer, if the value cannot be 
  22. : |>     represented the result is implementation defined.
  23. : |> This requires an implementation to convert the integral type.  It does
  24. : |> not give it license to take actions not specified by the standard.
  25. : Does it?  I believe that it was the intent of the authors that the
  26. : `result' of the conversion could be a signal (for example) or a core
  27. : dump.  (This is, of course, the only reasonable thing for an
  28. : implementation to do.)
  29.  
  30. In 6.2.1.2, quoted above, it is not clear whether "result" refers to
  31. the "resulting value" or to the "resulting behavior".  IMHO, it should
  32. unambiguously refer to the former --- I see no need to open the door
  33. to the various shenanigans that standard euphemistically calls,
  34. "undefined behavior."  
  35.  
  36. Tom Payne  (thp@cs.ucr.edu)
  37.